# Importing Data
INDIA<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Aluminium/Aluminium.xlsx",sheet = "Sheet1", range = "R1:R264")

# Checking the Imported Data
View(INDIA)
# Creating Time Series Data
INDIA_ts <- ts(INDIA, start=c(1998,1), end=c(2018,12), frequency=12)
# Viewing and Checking the Created Time Series Data
INDIA_ts
sum(is.na(INDIA_ts))
library(forecast)
INDIA_ts <- tsclean(INDIA_ts)
INDIA_ts

# Identification: Plotting the Time Series Data
plot(INDIA_ts)

# Estimating the appropriate model
INDIA_ts_model <- auto.arima(INDIA_ts)
INDIA_ts_model

# Forecasting
options(max.print=1000000)
INDIA_ts_forecast <- forecast (INDIA_ts_model, level=c(95), h=364)
plot(INDIA_ts_forecast)
INDIA_ts_forecast             

# Exporting
write.table(INDIA_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Aluminium/INDIA_TSA.csv", sep=",")
